home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1803 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.7 KB

  1. Subject: Talarm() problem
  2. Date: Wed, 3 Aug 94 11:18:28 +0100
  3. From: Torsten Scherer <itschere@techfak.uni-bielefeld.de>
  4.  
  5.  Hi!
  6.  
  7.  Yesterday I've been hit by a (to me) new problem: The program I was
  8. writing was hanging in an endless loop (well, actually that isn't
  9. new ;), so I added a SIGALRM handler to be called periodically to
  10. give me some diagnostic output about what's going wrong. The (new)
  11. problem is that this code starts doing its job, but then, some alerts
  12. later it simply doesn't get called any more. This happened under 1.10h6
  13. (although I doubt it's a specific _h6_ problem). The signal handler
  14. itself of course runs perfectly well and the rest of the program
  15. really doesn't do any nasty things. The only thing it does is calling
  16. Fselect() with another timeout. And that seems to be the problem: If
  17. you'll try this one:
  18.  
  19. /*
  20.  *    alarm.c
  21.  */
  22.  
  23. #include <osbind.h>
  24. #include <mintbind.h>
  25. #include <signal.h>
  26.  
  27. int sigalrm(long arg)
  28. {
  29.     Cconout(7);
  30.     Talarm(1);
  31.     return 0;
  32. }
  33.  
  34. void main()
  35. {
  36.     char    c;
  37.     long    mask;
  38.  
  39.     Psignal(SIGALRM, sigalrm);
  40.     Talarm(1);
  41.  
  42.     while (42) {
  43.         mask = 1;
  44.         (void)Fselect(200, &mask, 0L, 0L);
  45.         if (mask)
  46.             Fread(0, 1L, &c);
  47.     }
  48. }
  49.  
  50.  you'll see the effect that it stops beeping after some keys have been
  51. pressed. Due to earlier problems I've had with some `features' I'd like
  52. to ask: Is that officially documented behaviour? ;) It seems like every
  53. process supports only one active timeout. Shouldn't this be fixed?
  54.  
  55. ciao,
  56. TeSche
  57. --
  58. Torsten Scherer (TeSche, Schiller...), itschere@techfak.uni-bielefeld.de
  59. Faculty of Technology, University of Bielefeld, Germany, Europe, Earth...
  60. | Use any of "finger itschere@129.70.131.2-15" for adresses and more.    |
  61. | Last updated: 31. July 1994                        |
  62.